package com.sf.marathon.soul.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sf.marathon.soul.service.QueryCommonService;
import com.sf.marathon.soul.vo.AreasVO;
import com.sf.marathon.soul.vo.CitiesVO;
import com.sf.marathon.soul.vo.ProvincesVO;


/**
 * 公共查询
 */
@Controller
@RequestMapping("/queryCommon")
public class QueryCommonController {

    @Autowired
    private QueryCommonService service;

    @RequestMapping("/provinces")
    @ResponseBody
    public List<ProvincesVO> getProvinces() {
        return service.getProvinces();
    }

    @RequestMapping("/cities")
    @ResponseBody
    public List<CitiesVO> getCities(@RequestParam("provinceid") String provinceid) {
        return service.getCities(provinceid);
    }

    @RequestMapping("/areas")
    @ResponseBody
    List<AreasVO> getAreas(@RequestParam("cityid") String cityid) {
        return service.getAreas(cityid);
    }
}
